import axios from 'axios'

axios.defaults.baseURL = 'http://localhost:3000'

/** 获取list列表 */
export const getList = () => axios.get('/api/users')

/** 添加user */
export const addUser = (params) => axios.post('/api/add', params)

/** 更新user */
export const putUser = (params) => axios.put('/api/put', params)

/** 删除user */
export const delUser = (id) => axios.delete(`/api/del/${id}`)

/** 通过id,获取信息 */
export const getUserById = (id) => axios.get(`/api/users/${id}`)
